package afcp.alumni.util;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import javax.servlet.jsp.jstl.fmt.LocalizationContext;

import afcp.alumni.action.base.BaseAction;

public class ElFunctions {

	// Warning: functions declared here that are intended to be used as EL
	// functions must also be declared in the tld file, located in
	// src/main/webapp/WEB-INF/tld/my.tld

	public static String urlEncode(String url) throws UnsupportedEncodingException {
		return URLEncoder.encode(url, Conf.DEFAULT_CHARSET_NAME);
	}

	public static String msg(LocalizationContext bundle, String key) {
		return BaseAction.msg(bundle.getResourceBundle().getLocale(), key);
	}
}
